package com.action;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.util.DB;

public class Home {
	private String submit;
	public String getSubmit() {
		return submit;
	}
	public void setSubmit(String submit) {
		this.submit = submit;
	}
	private List<String> countryname;
	private List<String> secretques;
	public List<String> getSecretques() {
		return secretques;
	}
	public void setSecretques(List<String> secretques) {
		this.secretques = secretques;
	}
	public List<String> getCountryname() {
		return countryname;
	}
	public void setCountryname(List<String> countryname) {
		this.countryname = countryname;
	}
	public String execute()throws Exception
	{
		//System.out.println("In execute"+submit);
		countryname=new ArrayList<String>();
		secretques=new ArrayList<String>();
		//if(submit.equals("register"))
		//{
			System.out.println("Register page");
			String query="select * from countrycode ";
			ResultSet res;
			res=DB.readFromBmtcDB(query);
			while(res.next())
			{
				String ele=res.getString("countryname");
			
				countryname.add(ele);
				System.out.println("element"+ele);
			}
			String query1 ="select * from secretquestion";
			ResultSet res1;
			res1=DB.readFromBmtcDB(query1);
			while(res1.next())
			{
				String ele=res1.getString("secretques");
			
				secretques.add(ele);
				System.out.println("element"+ele);
			}
			
			return "register";
			
		//}
		
		//return "something";
				
	}

}
